package com.toubutu.audio.admin.controller;


import com.toubutu.anno.LoginRequired;
import com.toubutu.audio.admin.dto.AdminUserQueryDto;
import com.toubutu.audio.admin.service.UserService;
import com.toubutu.audio.admin.vo.AdminUserVo;
import com.toubutu.common.PageUtils;
import com.toubutu.common.Result;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 戒燥
 * @since 2023-09-30
 */
@Api(tags = "后台管理--用户管理接口")
@RestController
@RequestMapping("/admin/user")
@LoginRequired
public class AdminUserController {
    @Resource
    private UserService userService;

    @PostMapping("/page/list")
    @ApiOperation("分页查询用户列表")
    public Result<PageUtils<AdminUserVo>> pageQueryUser(@RequestBody AdminUserQueryDto queryDto){
        return Result.ok(userService.pageQueryAdminUser(queryDto));
    }
}
